import request from '@/utils/request'

let baseUrl = "http://49.232.151.242:8080/"

export function fetchList(currPage,size) {
    return request({
        url: baseUrl+'note/findAllByPage?currentPage='+currPage+'&pageSize='+size,
        method: 'get',
        params: {}
    })
}

export function fetchListType(currPage,size,typeName) {
    return request({
        url: baseUrl+'note/findAllByPage?currentPage='+currPage+'&pageSize='+size+'&typeName='+typeName,
        method: 'get',
        params: {}
    })
}

export function getAllType() {
    return request({
        url: baseUrl+'type/getAllType',
        method: 'get',
        params: {}
    })
}

export function fetchFocus() {
    return request({
        url: '/focus/list',
        method: 'get',
        params: {}
    })
}

export function fetchCategory() {
    return request({
        url: '/category',
        method: 'get',
        params: {}
    })
}

export function fetchFriend() {
    return request({
        url: baseUrl+'links/getAllLink',
        method: 'get',
        params: {}
    })
}

export function fetchSocial() {
    return request({
        url: '/social',
        method: 'get',
        params: {}
    });
}

export function fetchSiteInfo() {
    return request({
        url: '/site',
        method: 'get',
        params: {}
    })
}

export function fetchComment() {
    return request({
        url: '/comment',
        method: 'get',
        params: {}
    })
}

export function test(currentPage,pageSize) {
    return request({
        url: baseUrl+'note/findAllByPage?currentPage='+currentPage+'&pageSize='+pageSize,
        method: 'get',
        params: {}
    })
}


export function propose(ruleForm) {
    return request({
        url: baseUrl+'note/propose',
        method: 'post',
        data: ruleForm
    })
}
export function getTenMessage() {
    return request({
        url: baseUrl+'note/getTenMessage',
        method: 'get',
        params: {}
    })
}

export function getNoteInfo(id) {
    return request({
        url: baseUrl+'note/findNoteById/'+id,
        method: 'get',
        params: {}
    })
}

export function getAllTools(param) {
    return request({
        url: baseUrl+'note/getAllTools/'+param,
        method: 'get',
        params: {}
    })
}

export function search(param) {
    return request({
        url: baseUrl+'note/search?searchText='+param+'&pageNum=1'+"&pageSize=100",
        method: 'get',
        params: {}
    })
}